<!DOCTYPE html>
<html>
<head>
<script src="../../resources/gc.js"></script>
<script src="../../resources/js-test.js"></script>
</head>
<body>
<script>
jsTestIsAsync = true;
function createTree() {
    var div = document.createElement("div");
    div.appendChild(document.createElement("div"));
    div.appendChild(document.createElement("div"));
    div.appendChild(document.createElement("div"));
}

var num1, num2, num3;
asyncGC(function() {
    num1 = internals.numberOfLiveNodes();
    createTree();
    num2 = internals.numberOfLiveNodes();
    asyncMinorGC(function() {
        num3 = internals.numberOfLiveNodes();
        shouldBe('num2', 'num1 + 4');
        shouldBe('num3', 'num1');
        finishJSTest();
    });
});
</script>
</body>
</html>
